package repositories;

import java.util.Collection;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.stereotype.Repository;

import domain.UserGroup;

@Repository
public interface UserGroupRepository extends JpaRepository<UserGroup, Integer> {

	@Query("select g from UserGroup g where g.id not in( select v.userGroup.id from  Vacancy v where v.project.id=?1)")
	Collection<UserGroup> findAvailableGroups(int projectId);
	
	
}
